app.controller('marketCtrl',['$scope','$http',function($scope,$http){
	$scope.index = 0
	$scope.strDate = [];
	$scope.selected = "";
	$scope.leftList=['热销榜','天天特价','优先水果','牛奶面包','卤味熟食','进口食品','饮料酒水','牛奶面包','卤味熟食','进口食品','饮料酒水'
	,'饮料酒水','牛奶面包','卤味熟食','进口食品','饮料酒水'];
	
     $scope.oli = function(i,text){
		$scope.index = i;
		resque(text);
	}
     
     function resque(text){
     	$http({
     		method:'GET',
     		url:'http://h5.yztctech.net/api/axf/apicategory.php',
     		params:{
     			category:text,
     		}
     	}).success(function(res){
     		$scope.strDate = res.data;
     		$scope.selected = text;
     		console.log($scope.strDate);
     		
     	})
     }
     
     resque();
     
//   $scope.addCar = function(i,num){
//   	if(i.num){
//   		i.num += num;
//   	}else{
//   		i.num = 1
//   	}
//   }
//   
//   shopCar.addCar(i,$scope.text);
     
}]);